#include "algohub_common_type.h"
#include "AlgoEvaluatorModule0Topography.h"
#include "AlgoEvaluator.h"

int main()
{
	//  int exec(
	//  	const algobase::Path & path,
	//  	const algobase::TaskConfig & config,
	//  	const algobase::EvaluateL1IndexMap & index,
	//  	double& result,
	//  	algobase::EvaluatorCoords & resultCoords);

	algobase::TaskConfig config;
	config.mStartTime = algobase::Date(2023, 1, 0);
	config.mEndTime = algobase::Date(2023, 6, 0);
	config.mMinLongitude = -5;
	config.mMaxLongitude = 5;
	config.mMinLatitude = -5;
	config.mMaxLatitude = 5;
	config.mDateType = algobase::DT_Month;

	algobase::Path path;
	for (int i = 0; i < 10; ++i)
	{
		algobase::PathCoord path_coord;
		path_coord.mCoordZ = { 1.0 * i, 1.0 * i, 0 };
		path.emplace_back(path_coord);
	}

	algobase::EvaluateL2IndexWeightVector Safe, Stealth, Economy, Completion;
	Safe.emplace_back(algobase::EvaluateL2IndexType::EL2IT_0Topography, 0.2);
	Safe.emplace_back(algobase::EvaluateL2IndexType::EL2IT_10TimeCompletion, 0.5);
	Safe.emplace_back(algobase::EvaluateL2IndexType::EL2IT_12HardRestriction, 0.3);
	Stealth.emplace_back(algobase::EvaluateL2IndexType::EL2IT_3CPCD, 0.7);
	Stealth.emplace_back(algobase::EvaluateL2IndexType::EL2IT_1EnvironmentalNoise, 0.3);
	Economy.emplace_back(algobase::EvaluateL2IndexType::EL2IT_2Turbulence, 0.5);
	Economy.emplace_back(algobase::EvaluateL2IndexType::EL2IT_4AcousticStealth, 0.5);
	Completion.emplace_back(algobase::EvaluateL2IndexType::EL2IT_7NavigationTime, 1.0);

	algobase::EvaluateL1IndexMap L1Indexmap;
	L1Indexmap[algobase::EL1IT_Safety].first = 0.2;
	L1Indexmap[algobase::EL1IT_Safety].second = Safe;
	L1Indexmap[algobase::EL1IT_Stealth].first = 0.3;
	L1Indexmap[algobase::EL1IT_Stealth].second = Stealth;
	L1Indexmap[algobase::EL1IT_Economy].first = 0.3;
	L1Indexmap[algobase::EL1IT_Economy].second = Economy;
	L1Indexmap[algobase::EL1IT_Completion].first = 0.2;
	L1Indexmap[algobase::EL1IT_Completion].second = Completion;

	double result;
	algobase::EvaluatorCoords resultCoords;

	algo::AlgoEvaluator algoEva;
	algoEva.setEvaluateL1IndexMap(L1Indexmap);
	algoEva.setTaskConfig(config);

	int exec_code = algoEva.exec(path, result, resultCoords);
	if (!exec_code) {
		return -1;
	}

	return 0;
}